package org.wu.framework.lazy.orm.database.jpa.repository.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum MethodName2SQLType {


    //    "select", "find", "page", "get", "query", "update", "change", "delete","remove"
    SELECT("select", "select", QueryType.SELECT),
    FIND("find", "select", QueryType.SELECT),
    PAGE("page", "select", QueryType.SELECT),
    GET("get", "select", QueryType.SELECT),
    QUERY("query", "select", QueryType.SELECT),
    LIST("list", "select", QueryType.SELECT),


    UPDATE("update", "update", QueryType.UPDATE),
    CHANGE("change", "update", QueryType.UPDATE),

    DELETE("delete", "delete", QueryType.DELETE),
    REMOVE("remove", "delete", QueryType.DELETE),


    INSERT("insert", "insert into ", QueryType.INSERT),
    SAVE("save", "insert into", QueryType.INSERT),
    ;

    /**
     * 方法前缀
     */
    private final String startMethodNamePrefix;
    /**
     * sql 执行前缀
     */
    private final String sqlPrefix;
    /**
     * 方法执行类型
     */
    private final QueryType queryType;
}
